package io.renren.modules.app.controller;

import io.renren.common.utils.ResponseModel;
import io.renren.modules.app.annotation.Login;
import io.renren.modules.sys.entity.ContentEntity;
import io.renren.modules.sys.service.ContentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/app/content")
@Api(tags = "app-公告内容")
public class AppContentController {
    @Autowired
    private ContentService contentService;

    @GetMapping("/detail/{type}")
    @ApiOperation("详情")
    public ResponseModel<ContentEntity> info(@PathVariable("type") String type){
        ContentEntity content = contentService.getByType(type);

        return ResponseModel.of(content);
    }

}
